﻿using FairyGUI;
using System.Collections;

/// <summary>
/// 等待组件
/// </summary>
public class UIGame_WaitingCtrl {

    GComponent _comp;

    public UIGame_WaitingCtrl(GComponent comp)
    {
        _comp = comp;

        GButton jiesanBtn = comp.GetChild("解散按钮").asButton;
        jiesanBtn.onClick.Add(() => {
            UIRootController.inst.ShowMask(true);
            GameDataKernel.inst.SendGameMessage(IOMessage.ForCode(IOCmds.CMSG_PLAYER_REQ_DESTROY_ROOM));
        });
    }

    public bool visible {
        get { return _comp.visible; }
        set { _comp.visible = value; _comp.enabled = value; }
    }
}
